<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-model结合select</title>
  <style>
    #app {
      text-align: center;
    }
  </style>
</head>

<body>

  <div id="app">
    <!-- 1. 单选select -->
    <select name="abc" id="" v-model="fruit">
      <option value="苹果">苹果</option>
      <option value="香蕉">香蕉</option>
      <option value="梨子">梨子</option>
      <option value="榴莲">榴莲</option>
    </select>
    <h3>您的选择是: {{ fruit }}</h3>

    <!-- 2. 多选select 使用ctrl -->
    <select name="abc" id="" v-model="fruits" multiple>
      <option value="苹果">苹果</option>
      <option value="香蕉">香蕉</option>
      <option value="梨子">梨子</option>
      <option value="榴莲">榴莲</option>
    </select>
    <h3>您的选择是: {{ fruits }}</h3>

    <!-- 3. 值绑定 -->
    <label v-for="item in originHobbies" :for="item">
      <input type="checkbox" :value="item" :id="item" v-model="hobbies"> {{ item }}
    </label>
    <h3>您的选择是: {{ hobbies }}</h3>

  </div>

  <script src="../../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        fruit: "香蕉",
        fruits: [],
        originHobbies: ['篮球', '足球', '乒乓球', '羽毛球', '台球', '高尔夫'],
        hobbies: []
      }
    })
  </script>
</body>

</html>